package leetcode.offer;

/**
 * ClassName: NumWays
 * Description:leetcode-剑指offer 10 - II.青蛙跳台阶
 * date: 2021-11-03 10:44
 *
 * @author liyifan
 */
public class NumWays {
    public int numWays(int n){
        final int MOD = 1000000007;
        int[] cache = new int[110];
        cache[0] = 1;
        cache[1] = 1;
        cache[2] = 2;
        for (int i = 3;i <= n;i++) {
            cache[i] = (cache[i - 1] + cache[i - 2]) % MOD;
        }
        return cache[n];
    }
}
